import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/home.vue'
import Nav from '../views/home/nav.vue'
import Category from '../views/home/category.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'nav',
    component: Nav,
    children: [
      {
        path: '/',
        name: 'home',
        component: Home
      },
      {
        path: '/category',
        name: 'category',
        component: Category
      },
      {
        path: '/cart',
        name: 'cart',
        component: () => import('../views/home/cart.vue')
      },
      {
        path: '/user',
        name: 'user',
        component: () => import('../views/home/user.vue')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
